﻿@model WeberTimeTracker.Models.Time

@{
    ViewBag.Title = "EnterTime";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>EnterTime</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Time</legend>
        
        <p>User</p>

        <div class="editor-field">
            @Html.DropDownList("User_ID", (SelectList)ViewBag.UserId, "--Select One--") 
            @Html.ValidationMessageFor(model => model.User_ID)
        </div>

        <p>Project Name</p>

        <div class="editor-field">
            @Html.DropDownList("Project_ID", (SelectList)ViewBag.ProjectId, "--Select One--") 
            @Html.ValidationMessageFor(model => model.Project_ID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Hours)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Hours)
            @Html.ValidationMessageFor(model => model.Hours)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Date)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Date)
            @Html.ValidationMessageFor(model => model.Date)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Description, 10, 80, new { @style = "resize: none;" })
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        <p>
            <input type="submit" value="Add" />
        </p>
    </fieldset>
}

